export default {
  cover: [{ required: true, message: "封面图片不能为空", trigger: "change" }],
  newsTitle: [{ required: true, message: "文章标题不能为空", trigger: "blur" }],
  content: [
    { required: true, message: "文章内容不能为空", trigger: "blur" },
    {
      validator: (rule, value, callback) => {
        const cleanedContent = value.replace(/<(?!img|video)[^>]*>/g, '').trim();
        if (cleanedContent === "") {
          callback(new Error("文章内容不能为空"));
        } else {
          callback();
        }
      },
      trigger: ["blur", "change"],
    },
  ],
  enabled: [{ required: true, message: "启用不能为空", trigger: "blur" }],
  createTime: [
    { required: true, message: "创建时间不能为空", trigger: "blur" },
  ],
  updateTime: [
    { required: true, message: "修改时间不能为空", trigger: "blur" },
  ],

  newsDiscription: [
    { required: true, message: "文章说明不能为空", trigger: "blur" },
  ],
};
